// 声明变量
const state = {
  addRoutes: []
}

// commit提交给mutations
const actions = {
  addRoutes({ commit }, view) {
    commit('ADD_ROUTES', view)
  },
}

// mutations中修改state中的值
const mutations = {
  ADD_ROUTES: (state, view) => {
    state.addRoutes.push(view)
  },
}

export default {
  namespaced: true,
  state,
  actions,
  mutations
}